package com.my12306.train.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.my12306.common.model.vo.PageVo;
import com.my12306.common.util.PageUtils;
import com.my12306.common.util.response.ResponseData;
import com.my12306.train.model.entity.MileageEntity;
import com.my12306.train.model.vo.MileageRouteVo;
import com.my12306.train.model.vo.MileageVo;

import java.util.List;

/**
 * 里程service
 *
 * @author wj¦
 * @email
 * @date 2020-07-24 20:58:07
 */
public interface MileageService extends IService<MileageEntity> {
    /**
     * 分页查询里程
     *
     * @param pageVo
     * @return
     */
    PageUtils queryMileageByPage(PageVo pageVo);

    /**
     * 查询分页的总数据量
     *
     * @param pageVo      分页模型(内含相关查条件)
     * @param logicDelete (逻辑删除字段)
     * @return
     */
    Integer queryMileageCountByPage(PageVo pageVo, int logicDelete);

    /**
     * 添加里程信息
     *
     * @param mileageRouteVo
     * @return
     */
    Long saveMileage(MileageRouteVo mileageRouteVo);

    /**
     * 修改里程信息
     *
     * @param mileage
     */
    void updateMileageById(MileageEntity mileage);

    /**
     * 批量删除里程信息
     *
     * @param mileageIds
     */
    void deleteMileageBatchByIds(List<Long> mileageIds);

    /**
     * 根据线路id
     * 删除里程
     * @param routeIds
     */
    void deleteMileageByRouteId(List<Long>routeIds);
    /**
     * 根据车站id删除相关站点与站点之间的里程
     * 1.删除里程本身
     * 2.删除里程与线路的关系。
     *
     * @param stationId
     */
    void deleteMieleageByStationId(Long stationId);

    /**
     * 查询添加里程的相关参数
     * @return
     * @param mileageId
     */
    ResponseData getAddParamters(Long mileageId);

    /**
     * 根据id查询
     * @param mielageId
     * @param logicDelete
     * @return
     */
    MileageVo queryMileageVoByMileageId(Long mielageId, int logicDelete);
    /**
     * 根据id查询
     * @param mileageId
     * @param logicDelete
     * @return
     */
    MileageEntity queryMileageByMileageId(Long mileageId, int logicDelete);

    /**
     * 查询所有里程
     * @return
     */
    List<MileageEntity> queryAllMileage(int logicDelete);
}

